package com.yoj.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * 题目提交信息表
 */
@Accessors(chain = true)
@TableName(value = "question_submit")
@ApiModel(value = "题目提交信息")
@Data
public class QuestionSubmit implements Serializable {

    @ApiModelProperty(value = "题目提交 id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "编程语言", notes = "枚举类：java cpp go")
    @TableField(value = "language")
    private String language;

    @ApiModelProperty(value = "用户代码")
    @TableField(value = "code")
    private String code;

    @ApiModelProperty(value = "判题信息（json 对象）")
    @TableField(value = "judgeInfo")
    private String judgeInfo;

    @ApiModelProperty(value = "判题状态", notes = "枚举类：0-待判题、1-判题中、2-成功、3-失败")
    @TableField(value = "status")
    private Integer status;

    @ApiModelProperty(value = "题目 id（逻辑外键）")
    @TableField(value = "questionId")
    private Long questionId;

    @ApiModelProperty(value = "创建用户 id（逻辑外键）")
    @TableField(value = "userId")
    private Long userId;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "createTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updateTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @TableLogic
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}